﻿@using Domain.Dto.Selectors
@using Domain.Model
@model SelectorRequestDto
@{
    Layout = "_LayoutSelector";
}
<div class="row" style="width:auto;height:400px;">
    <iframe src="@ViewBag.url"></iframe>
</div>
<form asp-action="Add">
    <div class="form-group">
        <label asp-for="Name">ID</label>
        <input type="text" class="form-control" asp-for="Name">
        <span asp-validation-for="Name" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label asp-for="Type">Type</label>
        <select class="form-control" asp-for="Type" asp-items="@(Enum.GetValues<SelectorType>().Select(t=>new SelectListItem(){Text=t.ToString(),Value=t.ToString()}))"></select>
        <span asp-validation-for="Type" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label asp-for="Selector">Selector</label>
        <input type="text" class="form-control" asp-for="Selector">
        <span asp-validation-for="Selector" class="text-danger"></span>
    </div>
    <div class="form-check">
        <input asp-for="Multiple" class="form-check-input" type="checkbox">
        <label asp-for="Multiple" class="form-check-label">Multiple</label>
    </div>
    <div class="form-group">
        <label asp-for="Regex">Regex</label>
        <input type="text" class="form-control" asp-for="Regex">
        <span asp-validation-for="Regex" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label asp-for="ParentSelectorNames">Parent Selectors</label>
        <select multiple asp-items=@ViewBag.SelectList class="form-control" asp-for="ParentSelectorNames"></select>
        <span asp-validation-for="ParentSelectorNames" class="text-danger"></span>
    </div>
    <div class="form-group">
        <input type="hidden" name="fatherId" value=@ViewBag.fatherId />
        <input type="hidden" name="siteMapId" value=@ViewBag.siteMapId />
    </div>
    <button type="submit" class="btn btn-primary">Submit</button>
</form>
@section Scripts {
    @{
    await Html.RenderPartialAsync("_ValidationScriptsPartial");
}
}